<{include file="top_v2.html" }>
<link rel="stylesheet" href="<{$preStaticUrl}>Wap/v2/css/swiper-3.3.1.min.css" />
</head>
<body>
    <div id="wrap" class="pb housePage">
        <!-- 顶部广告 -->
        <{*轮播*}>
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <{foreach from=$marquee key=key item=item}>
                <div class="swiper-slide">
                    <a href="<{u('index/marqueJump?id='|cat:$item.id)}>"><img src="<{$preUploadUrl}><{$item.pic}>" alt="" /></a>
                </div>
                <{/foreach}>
            </div>
        </div>




        <div class="list">
            <ul id="datalist">
                <{include file="HouseWork/more.html" }>
            </ul>
        </div>
        <{include file="../footer.html" }>
    </div>
</body>
</html>


<script type="text/javascript">
    var loadMore = "<{U('HouseWork/loadMore')}>";
    var page=1;



    //拖动加载
    var flagData = true;
    var flagAjax = true;
    //加载
    function load_more(postData){
        if(! flagAjax){
            return false;
        }
        flagAjax = false;
        loadObj = load();
        $.getJSON(loadMore,postData , function(data){
            layer.close(loadObj);
            if (data.status != 0) {
                tip("数据获取失败，请稍后重试或联系管理员解决！");
            } else {
                ++page;
                $(".active-list").append(data.dataHTML);
                fixUserHead();
                if (data.isPage) flagAjax = true;
            }

        },'json');
    }

    var tmp_scroll = 0;
    //拖动加载
    function scroll_load(postData){
        if (tmp_scroll == $(window).height() + $(window).scrollTop()) {
            return;
        }
        tmp_scroll = $(window).height() + $(window).scrollTop();
        var jia_scroll = $(document).height() - ($(window).height() + $(window).scrollTop());
        if (jia_scroll < 100 && flagData) {
            load_more(postData);
        }
    }

    $(window).scroll(function(){
        if(page==1) page=2;
        scroll_load({page:page});
    });

</script>
<script src="<{$preStaticUrl}>Wap/v2/js/swiper-3.3.1.min.js"></script>
<script>
    $(function(){
        var mySwiper = new Swiper ('.swiper-container', {
            loop: true,
            autoplay: 3000,
            autoplayDisableOnInteraction: false
        })
    })
</script>
